package com.suray.rgv.son.mother.util;

/**
 * 子车按速度行驶状态
 */
public enum RgvSonMoveBySpeedStatus {
    INVALID(-1, "无效"),
    STANDY(0, "就绪"),
    MOVE_BY_SPEED(1, "按速度行驶"),
    STOP_MOVE_BY_SPEED(2, "按速度停止"),
    ;

    private int value;
    private String des;

    RgvSonMoveBySpeedStatus(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public int getValue() {
        return value;
    }

    public static RgvSonMoveBySpeedStatus parseStatus(int value) {
        for (RgvSonMoveBySpeedStatus status : RgvSonMoveBySpeedStatus.values()) {
            if (status.value == value) {
                return status;
            }
        }

        return INVALID;
    }

    @Override
    public String toString() {
        return des;
    }
}
